home *** CD-ROM | disk | FTP | other *** search
- class prop.pz3 extends MovieClip
- {
- var disk1;
- var disk2;
- var turnMax;
- var turnCnt;
- var overCnt;
- var frm1;
- var frm2;
- function pz3()
- {
- super();
- this.disk1.stop();
- this.disk2.stop();
- this.turnMax = 1 + Math.ceil(Math.random() * 3);
- trace("turnMax " + this.turnMax);
- this.turnCnt = 0;
- }
- function btnPrs()
- {
- this.overCnt = 0;
- _global.ctn.sndCtrl.playSound("snd_stoneSpin");
- if(this.turnCnt < this.turnMax)
- {
- this.turnCnt = this.turnCnt + 1;
- this.frm1 = "s" + Math.ceil(Math.random() * 6);
- this.frm2 = "s" + Math.ceil(Math.random() * 6);
- this.disk1.startAni(this.frm1);
- this.disk2.startAni(this.frm2);
- }
- else
- {
- this.frm1 = "s6";
- this.frm2 = "s6";
- this.disk1.startAni(this.frm1);
- this.disk2.startAni(this.frm2);
- }
- }
- function aniOver()
- {
- if(_global.scene.pot.runSta != "steamPot" && _global.scene.fireSeed.runSta == "hide")
- {
- this.turnCnt = 0;
- if(this._visible)
- {
- _global.ctn.sndCtrl.playSound("snd_pzWrong");
- }
- this._visible = false;
- }
- else
- {
- this.overCnt = this.overCnt + 1;
- if(this.overCnt >= 2)
- {
- trace("both of the ani over");
- if(this.frm1 == "s6" && this.frm2 == "s6")
- {
- trace("check is ok");
- if(_global.scene.pot.runSta == "steamPot" && _global.scene.fireSeed.runSta == "fire")
- {
- _global.ctn.sndCtrl.playSound("snd_pzRight");
- _global.scene.stoneDoorAni.spinAni.spinAniCtt.play();
- _global.scene.fireSeed.stop();
- _global.scene.steamBtn.unloadMovie();
- this._visible = false;
- if(!_global.scene.pzFireScoreOver)
- {
- _global.scene.pzFireScoreOver = true;
- _global.ctn.game.addScore(214,214,40,60);
- _global.ctn.game.addScore(124,Math.round(412 * (1 - this.turnCnt / this.turnMax)),40,60);
- }
- }
- else
- {
- _global.ctn.sndCtrl.playSound("snd_pzWrong");
- this._visible = false;
- }
- }
- }
- }
- }
- }
-